﻿Imports Mystery

Public Class ControlPropertySelector(Of Control1 As {UserControl, New},
                                                     Control2 As {UserControl, New},
                                                     condition As {IContentDrivenSelector(Of Boolean), New})
    Implements IContentDrivenSelector(Of UserControl)

    Private _condition As New condition


    Public Function getIt(content As Mystery.IContent) As System.Windows.Controls.UserControl Implements Mystery.IContentDrivenSelector(Of System.Windows.Controls.UserControl).getIt
        If _condition.getIt(content) Then
            Return New Control1
        Else
            Return New Control2
        End If

    End Function
End Class
